/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.view;

import com.model.Anggota;
import com.model.Perpustakaan;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

/**
 *
 * @author admin
 */
public class PanelCariAnggota extends JPanel {
    private JLabel labelJudul;
    private JLabel labelNama;
    private JTextField textNama;
    private JLabel labelHasil;
    private JButton buttonCari;
    private JTextArea areaHasil;
    
    public PanelCariAnggota(ArrayList<Anggota> data){
        setLayout(null);
        
        labelJudul = new JLabel("Cari Anggota");
        labelJudul.setBounds(150, 50, 150, 20);
        add(labelJudul);
        
        labelNama = new JLabel("Cari Nama");
        labelNama.setBounds(20, 110, 100, 20);
        add(labelNama);
        
        textNama = new JTextField();
        textNama.setBounds(90, 110, 150, 20);
        add(textNama);
        
        buttonCari = new JButton("Cari");
        buttonCari.setBounds(250, 110, 90, 20);
        add(buttonCari);
        buttonCari.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                tombolCariAction();
            }
        });
        
        labelHasil = new JLabel("Hasil Cari");
        labelHasil.setBounds(20, 140, 100, 20);
        add(labelHasil);
        
        areaHasil = new JTextArea();
        areaHasil.setSize(150, 160);
        areaHasil.setLocation(20, 160);
        this.add(areaHasil);
//        perpus.bacaFilePekerja();
//        areaPekerja.setText(Proyek.bacaDaftarPekerja());
        Perpustakaan.cariAnggota("James");
//        areaHasil.setText(Perpustakaan.cariAnggota("james"));
    }

    public PanelCariAnggota() {
        throw new UnsupportedOperationException("Not yet implemented");
    }
    
    public void tombolCariAction(){
        
    }
}
